<div class="users form">
<?php e($form->create('User', array('action' => 'config')));?>
    <fieldset>
        <legend><?php __('My Preference');?></legend>
        <?php e($form->input('nickname', array(
                            'label'=>__('Nickname', true),
                            'title' => __('Which will represent you when a comment is made', true),
                            'class' => 'input text'))); ?>
        <?php e($form->input('email', array(
                            'label'=>__('Email', true),
                            'title' => __('Provide your most used email address', true),
                            'class' => 'input text'))); ?>
        <?php e($form->submit(__('Save Changes', true), array('class' => 'submit attention'))); ?>
    </fieldset>
<?php e($form->end()); ?>
</div>
<script type="text/javascript">
jQuery(function(){
    $('#UserConfigForm').submit(function(event){
        if(!$(this).valid()){ return false;}
    }).validate({
        rules: {
            'data[User][nickname]': {required: true},
            'data[User][email]': {email: true}
        },
        messages: {
            'data[User][nickname]': { required: '请勿将昵称设置为空值'},
            'data[User][email]': { email: '请填写正确的电子邮件地址, 如example@domain.com' }
        }
    });
    /* Input tips */
    $('input').tooltip({
        position: 'center right',
        offset: [20, 5],
        tip: '#tooltip',
        lazy: false,
        effect: 'slide'
    }).dynamic({
        right: {
            direction: 'down',
            bounce: true
        }
    });
});
</script>